<template>
	<view>
		<uni-titles :title="'巡田地'"></uni-titles>
		<uni-farmtitle :title="'我的农场'" :num="'58'" serchShow @isshow="show = !show"></uni-farmtitle>
		<uni-serchs v-if="show"></uni-serchs>
		<uni-menu :list="menulist" @mchange="mchange"></uni-menu>
		<uni-farmlist :list="farmlist" @itemClick="itemClick" :rightText="'开始巡田'" :rightTextColor="'#1E7BFB'">

		</uni-farmlist>
		<uni-more></uni-more>
		<uni-farmtitle :title="'巡田记录'" :num="'32'"></uni-farmtitle>
		<uni-farmrecord :list="farmlist2" @itemClick="recordClick"></uni-farmrecord>
		<uni-more></uni-more>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				menulist: [{
					name: '大棚',
					num: 12
				}, {
					name: '果园',
					num: 12
				}, {
					name: '大田',
					num: 8
				}],
				menuact: 0,
				farmlist: [{
						name: '番茄',
						type: 5,
						zd: 5.2,
						where: '荷花池小花园',
						img: ''
					},
					{
						name: '8424西瓜',
						type: 3,
						zd: 18.1,
						where: '天府广场小花园',
						img: ''
					},
					{
						name: '番茄',
						type: 2,
						zd: 5,
						where: '清水河小区',
						img: ''
					}
				],
				farmlist2: [{
						name: '番茄',
						type: 5,
						zd: 5.2,
						where: '荷花池小花园',
						cz: '施肥、浇水、修建',
						ren: '罗伟',
						time: '2022-12-13',
						buchong: '此天地应该准备打农药和杀虫了',
						img: ''
					},
					{
						name: '8424西瓜',
						type: 3,
						zd: 18.1,
						where: '天府广场小花园',
						cz: '施肥、浇水',
						ren: '罗伟',
						time: '2022-12-11',
						img: ''
					},
					{
						name: '番茄',
						type: 2,
						zd: 5,
						where: '清水河小区',
						cz: '施肥、浇水、修建',
						ren: '罗伟',
						time: '2022-12-05',
						img: ''
					}
				]
			};
		},
		methods: {
			mchange(index) {
				if (index == 0) {
					this.farmlist = [{
							name: '番茄',
							type: 5,
							zd: 5.2,
							where: '荷花池小花园',
							img: ''
						},
						{
							name: '8424西瓜',
							type: 3,
							zd: 18.1,
							where: '天府广场小花园',
							img: ''
						},
						{
							name: '番茄',
							type: 2,
							zd: 5,
							where: '清水河小区',
							img: ''
						}
					];
				} else if (index == 1) {
					this.farmlist = [{
						name: '8424西瓜',
						type: 3,
						zd: 18.1,
						where: '天府广场小花园',
						img: ''
					}];
				} else if (index == 2) {
					this.farmlist = [{
						name: '番茄',
						type: 2,
						zd: 5,
						where: '清水河小区',
						img: ''
					}];
				}
				this.menuact = index;
			},
			itemClick() {
				uni.navigateTo({
					url: '/subpkg/xuntd/xuntd'
				});
			},
			recordClick() {
				uni.navigateTo({
					url: '/subpkg/xuntd/xuntddetails',
				});
			}
		}
	};
</script>

<style lang="scss">
	page {
		background: #f6f6f6;
		padding-bottom: 30rpx;
	}

	.xuntd-content {
		padding: 24rpx 30rpx 0 30rpx;

		.tdmsg {
			padding: 24rpx 22rpx;

			.title {
				color: #3e3e3e;
			}

			.item {
				display: flex;
				margin-top: 20rpx;
				color: #3e3e3e;
				align-items: center;

				.name {
					margin-right: 20rpx;
				}

				.type {
					margin-left: 14rpx;
				}
			}

			.itemdklx .text {
				background: #dbffec;
				border: 1px solid #07c160;
				border-radius: 6rpx;
				color: #12d05c;
				height: 44rpx;
				line-height: 44rpx;
				padding: 0 24rpx;
			}

			.itemzzzw .type {
				background: #eaf9ff;
				border: 1px solid #10b9ff;
				border-radius: 6rpx;
				color: #13b3ee;
				height: 32rpx;
				line-height: 32rpx;
				padding: 0 12rpx;
			}
		}
	}

	.bgstyle {
		background: #fff;
		border-radius: 8rpx;
		margin-bottom: 30rpx;
	}
</style>
